#include <iostream>
#include "..//Z80Core/z80.h"
#include "GenTables.h"
#include "CheckTables.h"
#include "itables.h"

using namespace std;

int LastCheck()
{
	for ( int c = 0; c <= 255 ; ++c)
	{
		if (SZTable[c] != ZSTable[c])
		{
			cout << "ERR @ SZ" << endl;
			return 0;
		}
	}

	for ( int c = 0; c <= 255 ; ++c)
	{
		if (SZPTable[c] != PZSTable[c])
		{
			cout << "ERR @ SZP" << endl;
			return 0;
		}
	}

	for ( int c = 0, tmp; c <= 2047 ; ++c)
	{
		tmp = (c & 0x1FF) | (((c & BIT9)?BIT10:0) | ((c & BIT10)?BIT9:0));

		if (iDAATable[c] != DAATable[tmp])
		{
			cout << "ERR @ DAA" << endl;
			return 0;
		}
	}

	cout << "OK!" << endl;
	return 1;
}